import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/my_team_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class MyTeamEntity {
  late int code = 0;
  late String msg;
  late MyTeamData data = MyTeamData();

  MyTeamEntity();

  factory MyTeamEntity.fromJson(Map<String, dynamic> json) => $MyTeamEntityFromJson(json);

  Map<String, dynamic> toJson() => $MyTeamEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class MyTeamData {
  late MyTeamDataInfo info = MyTeamDataInfo();
  late List<MyTeamDataList> list = [];

  MyTeamData();

  factory MyTeamData.fromJson(Map<String, dynamic> json) => $MyTeamDataFromJson(json);

  Map<String, dynamic> toJson() => $MyTeamDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class MyTeamDataInfo {
  late String id = '';
  late String name = '';
  late String avatar = '';
  @JSONField(name: "level_id")
  late String levelId = '';
  @JSONField(name: "copartner_id")
  late String copartnerId = '';
  @JSONField(name: "team_money")
  late String teamMoney = '';
  @JSONField(name: "team_count")
  late String teamCount = '';
  @JSONField(name: "today_money")
  late String todayMoney = '';
  @JSONField(name: "level_name")
  late String levelName = '';
  @JSONField(name: "copartner_name")
  late String copartnerName = '';

  MyTeamDataInfo();

  factory MyTeamDataInfo.fromJson(Map<String, dynamic> json) => $MyTeamDataInfoFromJson(json);

  Map<String, dynamic> toJson() => $MyTeamDataInfoToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class MyTeamDataList {
  late String id = '';
  late String name = '';
  late String avatar = '';
  @JSONField(name: "level_id")
  late String levelId = '';
  @JSONField(name: "copartner_id")
  late String copartnerId = '';
  late String pid = '';
  late String node;
  @JSONField(name: "team_money")
  late String teamMoney = '';
  @JSONField(name: "team_count")
  late String teamCount = '';
  @JSONField(name: "is_slide")
  late String isSlide = '';
  @JSONField(name: "level_name")
  late String levelName = '';
  @JSONField(name: "copartner_name")
  late String copartnerName = '';
  @JSONField(name: "created_at")
  late String createdAt = '';


  MyTeamDataList();

  factory MyTeamDataList.fromJson(Map<String, dynamic> json) => $MyTeamDataListFromJson(json);

  Map<String, dynamic> toJson() => $MyTeamDataListToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
